<template>
    <div class="view" :class="{'click-bg':isClick}" @click="click"> 
        <slot></slot>
    </div>
</template>
<script>
import { ref } from 'vue'
export default {
    name:'View',
    setup(){
        const isClick=ref(false)
        let timeId=null
        const click=()=>{
            isClick.value=true
            clearTimeout(timeId)
            timeId=setTimeout(()=>{
                isClick.value=false
            },300)
        }
        return {
            isClick,
            click
        }
    }

}
</script>
<style lang="stylus" scoped>
    .click-bg{
        background-color:#fff7eb!important
        transition all .3s
    }
</style>